/*
# Rouleur Log - A log for cyclists.
# Copyright (C) 2006  Edward Copony (ecopony@gmail.com)
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
package com.blazingredfireball.rouleurlog.vo
{
	import com.adobe.cairngorm.vo.IValueObject;
	
	[Bindable]
	public class RideVO implements IValueObject
	{
		
		public var id:int;
		public var distance:Number;
		public var comments:String;
		public var riding_time:String;
		public var average_speed:Number;
		public var max_speed:Number;
		
		//These two are needed to map the results back from the getRides command
		//TODO- see if there is a better way to do this.
		public var route_id:int;
		public var bike_id:int;
		
		public var elevation_gain:Number;
		
		//Made private and use accessors to handle lame SQLite date handling
		private var _ride_on:Date = new Date();
		
		public var created_on:Number;
		public var updated_on:Number;
		//public var bike:BikeVO;
		//public var route:RouteVO;
		
		public function set ride_on(value:Number):void
		{
			_ride_on = new Date();
			_ride_on.setTime(value);
		}
		
		public function get ride_on():Number
		{
			return _ride_on.getTime();
		}
		
		public function get ride_on_Date():Date
		{
			return _ride_on;
		}
		
		public function set ride_on_Date(date:Date):void
		{
			_ride_on = date;
		}
	}
}